/**
 * Copyright (c) 2022 大漠穷秋.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 */
import ICEBaseComponent from './ICEBaseComponent';

/**
 * @class ICEImage
 * TODO:支持以下几种图片类型：jpg/jpeg/png/gif
 * TODO:ICEImage 来源的几种方式
 * @author 大漠穷秋<damoqiongqiu@126.com>
 */
class ICEImage extends ICEBaseComponent {
  constructor(props: any = {}) {
    super({ width: 100, height: 100, ...props });
  }

  /**
   * 空实现。
   */
  protected initEvents() {}

  protected doRender(): void {
    let img = new Image();
    img.src =
      '';
    this.ctx.drawImage(
      img,
      0 - this.state.localOrigin.x,
      0 - this.state.localOrigin.y,
      this.state.width,
      this.state.height
    );

    super.doRender();
  }
}

export default ICEImage;
